package com.honglang.module.article.service;


import java.util.Date;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.honglang.common.tools.Pager;
import com.honglang.module.article.entity.BlogArticle;


public interface BlogArticleService {
	
	/**
	 * save the blogArticle
	 * @param blogArticle
	 * @return
	 */
	@Transactional(readOnly = false)
	public BlogArticle save(BlogArticle blogArticle);

	
	/**
	 * get all the blogArticles;
	 * @return
	 */
	public List<BlogArticle> getAll();
	
	

	/**
	 * get the BlogArticle of one page;
	 * @param pageSize
	 * @param pageNo
	 * @return
	 */
	public Pager getPager(int pageSize,int pageNo);
	
	
	

	/**
	 * get the blogArticle BY id 
	 * @param blogArticleId
	 * @return
	 */
	public BlogArticle getBlogArticleById(Integer blogArticleId);
	
	/**
	 * delete blogArticle by id;
	 * @param blogArticleId
	 */
	@Transactional(readOnly = false)
	public void deleteBlogArticle(Integer blogArticleId);
	
	
	

	/**
	 * delete blogArticle in List
	 * @param blogArticleList
	 */
	@Transactional(readOnly = false)
	public void deleteBlogArticleList(List<BlogArticle> blogArticleList);




	/**
	 * get blogaArticles by ids (ids formart : "3_12_34")
	 * @param blogArticleIds
	 * @return
	 */
	public List<BlogArticle> getBlogArticleByIds(String blogArticleIds);
	
	
	/**
	 *  get the blogArticle which date is early then the param
	 * @param date
	 * @return
	 */
	public BlogArticle getPreBlogArticleByDate(Date date);
	
	
	/**
	 *  get the blogArticle which date is later then the param
	 * @param date
	 * @return
	 */
	public BlogArticle getNextBlogArticleByDate(Date date);
	

	/**
	 * get the newest blogArticle;
	 * @param maxResult
	 * @return
	 */
	public List<BlogArticle> getRecentBlogArticle(int maxResult);
	

	/**
	 * get the article count under a article category;
	 * @param articleCategoryId
	 * @return
	 */
	public Integer getArticleCountInOneCategory(Integer articleCategoryId);
}
